using UnityEngine;

public class LoopTrigger : MonoBehaviour
{
	public bool check;

	private float countDown;

	public LoopDetector loopDetector;

	private void OnTriggerEnter(Collider other)
	{
		if ((bool)other.GetComponent<CarBehavior>() && other.GetComponent<CarBehavior>().isMine)
		{
			check = true;
			countDown = loopDetector.unCheckTime;
			loopDetector.CheckLoop();
		}
	}

	private void Update()
	{
		if (check)
		{
			if (countDown > 0f)
			{
				countDown -= Time.deltaTime;
			}
			else
			{
				check = false;
			}
		}
	}
}
